<template>
<div>
   <div class="g_top_box">
		<div class="g_right_box"></div> 
		<div class="g_left_box"><h4>系统配置</h4></div>
	</div>
	<div class="g_content_box">

		<Form :model="info" label-position="left" :label-width="100">
			<FormItem :label="val.title" v-for="(val,index) in list" :key="index">
				<Input v-model="info[val.name]" style="width:200px;"></Input>
				<span style="margin-left:10px;color:#999;">{{val.info}}</span>
			</FormItem>
			
			
			<FormItem>
				<Button type="primary" @click="save">提交</Button>
			</FormItem>
		</Form>

	</div>
</div>
</template>

<script>
export default {
    name: 'config',
    data () {
        return {
            list:[],
			info:{}
        };
    },
	created(){
		this.load_data();
	},
    computed: {
       
    },
	methods:{
		load_data(){
			
			var self = this;
			Whttp.load("System/Config/get_list",{},function(result){
				self.list = result;
				for(var i=0;i<self.list.length;i++){
					self.info[self.list[i].name] = self.list[i].value;
				}
				
				
			});
		},
		save(){
			var self = this;
			var postdata = {
				info:this.info
			};
			Whttp.load("System/Config/save",postdata,function(result){
				alert('保存成功');
			});

		}
	}
};
</script>